#ifndef __KSVEDITOR_CONTROLLER_KTOOLCONTROLLER_H_
#define __KSVEDITOR_CONTROLLER_KTOOLCONTROLLER_H_
#include <QObject>


class KToolPanelWidget;
enum KShapeType;
class KToolButton;
class KExportJsonRead;

class KToolController:public QObject
{
	Q_OBJECT
public:
	explicit KToolController(KToolPanelWidget* pToolWidget, QObject* parent = nullptr);
	~KToolController();

	void initializeFromSetting();

	signals:
		void shapeChangeSignal(KShapeType shapeType);

public slots:
	void showButtonPressed(KShapeType shapeType);


protected slots:

	void onBtnMouseClicked();
	void onBtnFreeHandClicked();
	void onBtnLineClicked();
	void onBtnRectClicked();
	void onBtnEllipseClicked();
	void onBtnStarClicked();
	void onBtnTextClicked();
	void onBtnZoomInClicked();
	void onBtnZoomOutClicked();
	void onBtnPentagonClicked();
	void onBtnRhombusClicked();
	void onBtnCloudClicked();
	void onBtnHeartClicked();
	void onBtnHexagonClicked();


	void onBtnHovered(const QString& buttonId, KToolButton* button);

	void onJsonReady();

private:
	void setupButtonClickedConnections();
	void setUpButtonHoveredConnections();
	void setUpJsonConnections();

private:
	KToolPanelWidget* m_pToolWidget;
	
	KExportJsonRead* m_pJsonReader = nullptr;     
	bool m_jsonLoaded = false;
};
#endif //__KSVEDITOR_CONTROLLER_KTOOLCONTROLLER_H_